package cn.sciento.iam.domain.entity;

import cn.sciento.starter.keyencrypt.core.Encrypt;
import io.choerodon.mybatis.annotation.ModifyAudit;
import io.choerodon.mybatis.annotation.VersionAudit;
import io.choerodon.mybatis.domain.AuditDomain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

@ApiModel(value = "租户子模块管理")
@VersionAudit
@ModifyAudit
@Table(name = "iam_tenant_module")
public class TenantModule extends AuditDomain {

    public static final String FIELD_ID = "id";

    public static final String FIELD_TENANT_ID = "tenant_id";

    public static final String FIELD_MODULE_CODE = "module_id";

    @Id
    @GeneratedValue
    @Encrypt
    private Long id;

    @NotNull
    private Long tenantId;

    @ApiModelProperty(value = "模块编号")
    @NotNull
    private String moduleCode;


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getTenantId() {
        return tenantId;
    }

    public void setTenantId(Long tenantId) {
        this.tenantId = tenantId;
    }

    public String getModuleCode() {
        return moduleCode;
    }

    public void setModuleCode(String moduleCode) {
        this.moduleCode = moduleCode;
    }

    @Override
    public String toString() {
        return "TenantModule{" +
                "id=" + id +
                ", tenantId=" + tenantId +
                ", moduleCode='" + moduleCode + '\'' +
                '}';
    }
}
